public class java0629 {
    public static void main(String[] args) {
        // 基本类型
        int primitiveInt = 42;
        double primitiveDouble = 3.14;
        char primitiveChar = 'A';
        boolean primitiveBoolean = true;

// 手动装箱
        Integer boxedInt = Integer.valueOf(primitiveInt);  // 推荐方式
        Double boxedDouble = Double.valueOf(primitiveDouble);
        Character boxedChar = Character.valueOf(primitiveChar);
        Boolean boxedBoolean = Boolean.valueOf(primitiveBoolean);

// 也可以使用构造函数(Java 9后已废弃)
        Integer deprecatedBoxing = new Integer(primitiveInt);  // 不推荐
        System.out.println("hh");
    }
}
